package pers.xiaojun.boot.module.system.api.permission;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import pers.xiaojun.boot.common.biz.system.permission.PermissionApi;
import pers.xiaojun.boot.module.system.service.permission.PermissionService;

/**
 * 权限接口实现类
 *
 * @author xiaojun
 * @since 2025-10-10
 */
@Service
@RequiredArgsConstructor
public class PermissionApiImpl implements PermissionApi {

    private final PermissionService permissionService;

    @Override
    public boolean hasAnyPermissions(Long userId, String... permissions) {
        return permissionService.hasAnyPermissions(userId, permissions);
    }

    @Override
    public boolean hasAnyRoles(Long userId, String... roles) {
        return permissionService.hasAnyRoles(userId, roles);
    }
}
